{include file='../Common/read-header.html'}
<div class="addWrap" style="position:relative;">
  <div class="swipe1" id="mySwipe2">
		<div class="swipe-wrap">
			<div>
            	<img class="img-responsive"src="{$_C.hy_path}images/read/barckimg.png" width="100%" />
                <div class="noewen"><img src="{$_C.hy_path}images/read/noewen_02.png" width="565" height="56" /></div>
                <div class="noe_tu"><img src="{$_C.hy_path}images/read/noe_tu_02.png" width="850" height="320" /></div>
                <div class="miao"><img src="{$_C.hy_path}images/read/miao_02.png" width="850" height="330"/></div>
            </div>
			<div class="box2">
            	<img class="img-responsive" src="{$_C.hy_path}images/read/barckimg.png" width="100%" />
                <div class="twowen"><img src="{$_C.hy_path}images/read/twowen.png" width="662" height="61" /></div>
                <div class="no_xin_bg">
                	<!--<div class="img-con">
                		<img src="{$_C.hy_path}images/read/no_xin_bg.png" width="734" height="306"/>
                		<div class="img-zan">
                			<div vote = "1"   class="zan {if $vote.vote eq 1}zaned{/if}"></div>
                			<div class="zan-info">
                				<p>一瓣心香</p>
                				<p>获得<span class="zan-num" id="fir-vote">{$vote.first}</span>票</p>
                			</div>
                		</div>
                	</div>-->
					<div class="img-con">
                		<img src="{$_C.hy_path}images/read/no_xin_bg2_02.png" width="200" height="200"/>
                	</div>
                    <div class="vote-score">
                        <div class="vote-score-top">
                            <div class="progress-outer">
                                <div class="progress-inner" style="width:{$vote.first}%;"></div>
                            </div>
                            <p class="vote-score-num">{$vote.first}%</p>
                        </div>
                        <div class="vote-score-bottom">
                            <p class="vote-score-name">璀璨人生</p>
                            <span vote='1' class="vote-score-heart {if $vote.vote eq 1}full-heart{/if}"></span>
                        </div>
                    </div>
                </div>
                <div class="jin_x_bg">
                	<!--<div class="img-con">
	                	<img src="{$_C.hy_path}images/read/jin_x_bg.png" width="734" height="306"/>
	                	<div class="img-zan">
                			<div vote="2"  class="zan {if $vote.vote eq 2}zaned{/if}"></div>
                			<div class="zan-info">
                				<p>金桂飘香</p>
                				<p>获得<span class="zan-num" id="sec-vote">{$vote.second}</span>票</p>
                			</div>
                		</div>
                	</div>-->
					<div class="img-con">
	                	<img src="{$_C.hy_path}images/read/jin_x_bg2_02.png" width="200" height="200"/>
                	</div>
                    <div class="vote-score">
                        <div class="vote-score-top">
                            <div class="progress-outer">
                                <div class="progress-inner" style="width:{$vote.second}%;"></div>
                            </div>
                            <p class="vote-score-num">{$vote.second}%</p>
                        </div>
                        <div class="vote-score-bottom">
                            <p class="vote-score-name">金桂飘香</p>
                            <span vote='2' class="vote-score-heart {if $vote.vote eq 2}full-heart{/if} "></span>
                        </div>
                    </div>
                </div>
            </div>
		</div>
        <div class="leftjian"><img src="{$_C.hy_path}images/read/left.png" width="38" height="65"/></div>
	</div>
</div>
<table>
<tr>
    <td>
        <table width="100%" style="margin:20px 0px 0px 0px;">
        <tr>
            <td>
            <div class="lingq">
            	<a href="index.php?g=mobile&m=read&a=bookcoupons"><img src="{$_C.hy_path}images/read/youhuq.png" width="430" height="260" /></a>
            </div>                
            </td>
            <td>
            	<div class="xiangs">
            		<a href="index.php?g=mobile&m=read&a=perfume"><img src="{$_C.hy_path}images/read/xiang.png" width="430" height="260"/></a>
                </div>
            </td>
        </tr>   
        </table>
    </td>
</tr>
</table>
<div class="logo"><img src="{$_C.hy_path}images/read/logo.png" style="width:600px; height:80px;"/></div>

<div class="mask_zzc"></div>
<div class="alert" id="alert2" style="padding:15px">
	
		<div id="msg" class="fs3"></div>
		<a href="javascript:void(0)" class="alert-btn fc1 fs3">确定</a>
		
</div>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?808c919bdc18475fae43350429e11cb4";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
<script type="text/javascript">
	var is_vote = '{$vote.is_vote}';
	
var banner = Swipe(document.getElementById('mySwipe2'), {
	auto:0,
	continuous: false,
	disableScroll:false,
	callback: function(pos) {
		var i = bullets.length;
		while (i--) {
			bullets[i].className = ' ';
		}
		bullets[pos].className = 'cur';
	}
});
function noewens(){
			$(".addWrap .swipe-wrap .noewen").addClass('mywen');
		}

function twowen(){
			$(".addWrap .swipe-wrap .miao").addClass('mymiaos');
		}
	setInterval(noewens,500);
	setInterval(twowen,1500);
	
	
$('.vote-score-heart').click(function(){
	if(is_vote=="true"){
		showMsg("您无法再次投票");
		return false;
	}
	var _this = $(this);
	var vote = _this.attr('vote');
	var saveurl = "index.php?g=mobile&m=read&a=save_vote";
	var data = {
		vote:vote
		};
	$.post(saveurl,data,function(result){
		if(result.error==0){
		    _this.toggleClass('full-heart');
			is_vote = "true";
			showMsg2(result.content,"index.php?g=mobile&m=read&a=index");
		}else{
			showMsg2(result.content,"index.php?g=mobile&m=read&a=index");
		}
	},"json");
})
 	$('a.alert-btn').click(function (e) {
		$('div.alert').hide();
		$('.mask_zzc').hide();
	});
	function showMsg(msg){
		$("#msg").html(msg);
		$('#alert2').show();
		$('.mask_zzc').show();
	 }
   function showMsg2(msg,url){
		$('a.alert-btn').unbind("click");
		$('a.alert-btn').click(function(){
			console.info(url);
			window.location.href = url;
		});
		$("#msg").html(msg);
		$('#alert2').show();
		$('.mask_zzc').show();
 }
 
 wx.config({
		    debug: false, 
		   appId: '{$jsdk.appId}',
				timestamp: {$jsdk.timestamp},
				nonceStr: '{$jsdk.nonceStr}',
				signature: '{$jsdk.signature}',
		    jsApiList: [
		      // 所有要调用的 API 都要加到这个列表中
			  'onMenuShareTimeline',
	      	  'onMenuShareAppMessage',
		    ]
  });
		  
		   wx.ready(function () {
			
			 wx.onMenuShareTimeline({
			    title: '阅城之味',
			     link:'http://g4.shfyuan.com/ws/index.php?g=mobile&m=read&a=index',
			     imgUrl: 'http://g4.shfyuan.com/ws/Mobile/Webroot/gf/images/read/read-share.png',
			      trigger: function (res) {
			       
			      },
			      success: function (res) {
			    	 // document.getElementById('mcover').style.display='';
					//	showMsg("分享成功。");
			      },
			      cancel: function (res) {
			       
			      },
			      fail: function (res) {
			        showMsg(JSON.stringify(res));
			      }
		    });
		    
			wx.onMenuShareAppMessage({
			    link:'http://g4.shfyuan.com/ws/index.php?g=mobile&m=read&a=index',
			     title: '阅城之味',
			    desc: '用心去看、去经历方寸间，感受不同的城市、异样的人生',
			  	imgUrl: 'http://g4.shfyuan.com/ws/Mobile/Webroot/gf/images/read/read-share.png',
			    success: function () { 
			    	//document.getElementById('mcover').style.display='';
			    	//showMsg("分享成功。");
			    },
			    cancel: function () { 
			        // 用户取消分享后执行的回调函数
			    }
		});
});
</script>
</body>
</html>
